const { Service } = require('egg')

class HomeService extends Service{


    /**
     * 报告修改
     */
    async update(payload){
        return await this.ctx.model.Report.update(payload, {
            where: {
                id: payload.id
            }
        })
    }

    /**
     * 报告添加
     */
    async create(payload){
        return await this.ctx.model.Report.create(payload)
    }

    /**
     * 报告删除
     */
    async delete(payload){
        return await this.ctx.model.Report.destroy({
            where: {
                id: payload.id
            }
        })
    }
}


module.exports = HomeService